package com.zl.learning.arithmetic.util;

import java.util.Arrays;
import java.util.Random;

public class SortUtil {
    public static int[] getRandomArray() {
        return getRandomArray(7);
    }

    public static int[] getRandomArray(int size) {
        return new Random().ints(0, 100).limit(size).toArray();
    }

    public static void swap(int[] a, int i, int j) {
        int tmp = a[i];
        a[i] = a[j];
        a[j] = tmp;
    }

    public static void printArray(int[] a) {
        System.out.println(Arrays.toString(a));
    }

}
